home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / QuickTimeMusic.p < prev    next >
Encoding:
Text File  |  1998-02-12  |  72.1 KB  |  1,656 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QuickTimeMusic.p
  3.  
  4.      Contains:    QuickTime Interfaces.
  5.  
  6.      Version:    Technology:    QuickTime 3.0
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1990-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT QuickTimeMusic;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __QUICKTIMEMUSIC__}
  28. {$SETC __QUICKTIMEMUSIC__ := 1}
  29.  
  30. {$I+}
  31. {$SETC QuickTimeMusicIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __COMPONENTS__}
  35. {$I Components.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __IMAGECOMPRESSION__}
  38. {$I ImageCompression.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __MOVIES__}
  41. {$I Movies.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __QUICKDRAW__}
  44. {$I Quickdraw.p}
  45. {$ENDC}
  46. {$IFC UNDEFINED __VIDEO__}
  47. {$I Video.p}
  48. {$ENDC}
  49. {$IFC UNDEFINED __MACMEMORY__}
  50. {$I MacMemory.p}
  51. {$ENDC}
  52. {$IFC UNDEFINED __SOUND__}
  53. {$I Sound.p}
  54. {$ENDC}
  55. {$IFC UNDEFINED __ENDIAN__}
  56. {$I Endian.p}
  57. {$ENDC}
  58.  
  59.  
  60. {$PUSH}
  61. {$ALIGN MAC68K}
  62. {$LibExport+}
  63.  
  64.  
  65. CONST
  66.     kaiToneDescType                = 'tone';
  67.     kaiNoteRequestInfoType        = 'ntrq';
  68.     kaiKnobListType                = 'knbl';
  69.     kaiKeyRangeInfoType            = 'sinf';
  70.     kaiSampleDescType            = 'sdsc';
  71.     kaiSampleInfoType            = 'smin';
  72.     kaiSampleDataType            = 'sdat';
  73.     kaiSampleDataQUIDType        = 'quid';
  74.     kaiInstInfoType                = 'iinf';
  75.     kaiPictType                    = 'pict';
  76.     kaiWriterType                = '©wrt';
  77.     kaiCopyrightType            = '©cpy';
  78.     kaiOtherStrType                = 'str ';
  79.     kaiInstrumentRefType        = 'iref';
  80.     kaiInstGMQualityType        = 'qual';
  81.     kaiLibraryInfoType            = 'linf';
  82.     kaiLibraryDescType            = 'ldsc';
  83.  
  84.  
  85. TYPE
  86.     InstLibDescRecPtr = ^InstLibDescRec;
  87.     InstLibDescRec = RECORD
  88.         libIDName:                Str31;
  89.     END;
  90.  
  91.     InstKnobRecPtr = ^InstKnobRec;
  92.     InstKnobRec = RECORD
  93.         number:                    BigEndianLong;
  94.         value:                    BigEndianLong;
  95.     END;
  96.  
  97.  
  98. CONST
  99.     kInstKnobMissingUnknown        = 0;
  100.     kInstKnobMissingDefault        = $01;
  101.  
  102.  
  103. TYPE
  104.     InstKnobListPtr = ^InstKnobList;
  105.     InstKnobList = RECORD
  106.         knobCount:                BigEndianLong;
  107.         knobFlags:                BigEndianLong;
  108.         knob:                    ARRAY [0..0] OF InstKnobRec;
  109.     END;
  110.  
  111.  
  112. CONST
  113.     kMusicLoopTypeNormal        = 0;
  114.     kMusicLoopTypePalindrome    = 1;                            {  back & forth }
  115.  
  116.     instSamplePreProcessFlag    = $01;
  117.  
  118.  
  119. TYPE
  120.     InstSampleDescRecPtr = ^InstSampleDescRec;
  121.     InstSampleDescRec = RECORD
  122.         dataFormat:                BigEndianOSType;
  123.         numChannels:            BigEndianShort;
  124.         sampleSize:                BigEndianShort;
  125.         sampleRate:                BigEndianUnsignedFixed;
  126.         sampleDataID:            BigEndianShort;
  127.         offset:                    BigEndianLong;                            {  offset within SampleData - this could be just for internal use }
  128.         numSamples:                BigEndianLong;                            {  this could also just be for internal use, we'll see }
  129.         loopType:                BigEndianLong;
  130.         loopStart:                BigEndianLong;
  131.         loopEnd:                BigEndianLong;
  132.         pitchNormal:            BigEndianLong;
  133.         pitchLow:                BigEndianLong;
  134.         pitchHigh:                BigEndianLong;
  135.     END;
  136.  
  137.     AtomicInstrument                    = Handle;
  138.     AtomicInstrumentPtr                    = Ptr;
  139.  
  140. CONST
  141.     kQTMIDIComponentType        = 'midi';
  142.  
  143.     kOMSComponentSubType        = 'OMS ';
  144.     kFMSComponentSubType        = 'FMS ';
  145.     kMIDIManagerComponentSubType = 'mmgr';
  146.  
  147.  
  148. TYPE
  149.     QTMIDIComponent                        = ComponentInstance;
  150.  
  151. CONST
  152.     kMusicPacketPortLost        = 1;                            {  received when application loses the default input port  }
  153.     kMusicPacketPortFound        = 2;                            {  received when application gets it back out from under someone else's claim  }
  154.     kMusicPacketTimeGap            = 3;                            {  data[0] = number of milliseconds to keep the MIDI line silent  }
  155.  
  156.     kAppleSysexID                = $11;                            {  apple sysex is followed by 2-byte command. 0001 is the command for samplesize  }
  157.     kAppleSysexCmdSampleSize    = $0001;                        {  21 bit number in 3 midi bytes follows sysex ID and 2 cmd bytes  }
  158.     kAppleSysexCmdSampleBreak    = $0002;                        {  specifies that the sample should break right here  }
  159.     kAppleSysexCmdAtomicInstrument = $0010;                        {  contents of atomic instrument handle  }
  160.     kAppleSysexCmdDeveloper        = $7F00;                        {  F0 11 7F 00 ww xx yy zz ... F7 is available for non-Apple developers, where wxyz is unique app signature with 8th bit cleared, unique to developer, and 00 and 7f are reserved  }
  161.  
  162.  
  163. TYPE
  164.     MusicMIDIPacketPtr = ^MusicMIDIPacket;
  165.     MusicMIDIPacket = RECORD
  166.         length:                    UInt16;
  167.         reserved:                UInt32;                                    {  if length zero, then reserved = above enum  }
  168.         data:                    PACKED ARRAY [0..248] OF UInt8;
  169.     END;
  170.  
  171. {$IFC TYPED_FUNCTION_POINTERS}
  172.     MusicMIDISendProcPtr = FUNCTION(self: ComponentInstance; refCon: LONGINT; VAR mmp: MusicMIDIPacket): ComponentResult;
  173. {$ELSEC}
  174.     MusicMIDISendProcPtr = ProcPtr;
  175. {$ENDC}
  176.  
  177.     MusicMIDISendUPP = UniversalProcPtr;
  178. {$IFC TYPED_FUNCTION_POINTERS}
  179.     MusicMIDIReadHookProcPtr = FUNCTION(VAR mp: MusicMIDIPacket; myRefCon: LONGINT): ComponentResult;
  180. {$ELSEC}
  181.     MusicMIDIReadHookProcPtr = ProcPtr;
  182. {$ENDC}
  183.  
  184.     MusicMIDIReadHookUPP = UniversalProcPtr;
  185.  
  186. CONST
  187.     kSynthesizerConnectionFMS    = 1;                            {  this connection imported from FMS  }
  188.     kSynthesizerConnectionMMgr    = 2;                            {  this connection imported from the MIDI Mgr  }
  189.     kSynthesizerConnectionOMS    = 4;                            {  this connection imported from OMS  }
  190.     kSynthesizerConnectionQT    = 8;                            {  this connection is a QuickTime-only port  }
  191.                                                                 {  lowest four bits are mutually exclusive; combinations reserved for future use. }
  192.     kSynthesizerConnectionUnavailable = 256;                    {  port exists, but cannot be used just now  }
  193.  
  194.  
  195. TYPE
  196.     SynthesizerConnectionsPtr = ^SynthesizerConnections;
  197.     SynthesizerConnections = RECORD
  198.         clientID:                OSType;
  199.         inputPortID:            OSType;                                    {  terminology death: this port is used to SEND to the midi synth  }
  200.         outputPortID:            OSType;                                    {  terminology death: this port receives from a keyboard or other control device  }
  201.         midiChannel:            LONGINT;                                {  The system channel; others are configurable (or the nubus slot number)  }
  202.         flags:                    LONGINT;
  203.         unique:                    LONGINT;                                {  unique id may be used instead of index, to getinfo and unregister calls  }
  204.         reserved1:                LONGINT;                                {  should be zero  }
  205.         reserved2:                LONGINT;                                {  should be zero  }
  206.     END;
  207.  
  208.     QTMIDIPortPtr = ^QTMIDIPort;
  209.     QTMIDIPort = RECORD
  210.         portConnections:        SynthesizerConnections;
  211.         portName:                Str63;
  212.     END;
  213.  
  214.     QTMIDIPortListPtr = ^QTMIDIPortList;
  215.     QTMIDIPortList = RECORD
  216.         portCount:                INTEGER;
  217.         port:                    ARRAY [0..0] OF QTMIDIPort;
  218.     END;
  219.  
  220.     QTMIDIPortListHandle                = ^QTMIDIPortListPtr;
  221. FUNCTION QTMIDIGetMIDIPorts(ci: QTMIDIComponent; VAR inputPorts: QTMIDIPortListHandle; VAR outputPorts: QTMIDIPortListHandle): ComponentResult;
  222.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  223.     INLINE $2F3C, $0008, $0001, $7000, $A82A;
  224.     {$ENDC}
  225. FUNCTION QTMIDIUseSendPort(ci: QTMIDIComponent; portIndex: LONGINT; inUse: LONGINT): ComponentResult;
  226.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  227.     INLINE $2F3C, $0008, $0002, $7000, $A82A;
  228.     {$ENDC}
  229. FUNCTION QTMIDISendMIDI(ci: QTMIDIComponent; portIndex: LONGINT; VAR mp: MusicMIDIPacket): ComponentResult;
  230.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  231.     INLINE $2F3C, $0008, $0003, $7000, $A82A;
  232.     {$ENDC}
  233. FUNCTION QTMIDIUseReceivePort(ci: QTMIDIComponent; portIndex: LONGINT; readHook: MusicMIDIReadHookUPP; refCon: LONGINT): ComponentResult;
  234.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  235.     INLINE $2F3C, $000C, $0004, $7000, $A82A;
  236.     {$ENDC}
  237.  
  238.  
  239.  
  240. CONST
  241.     kMusicComponentType            = 'musi';
  242.     kInstrumentComponentType    = 'inst';
  243.  
  244.     kSoftSynthComponentSubType    = 'ss  ';
  245.     kGMSynthComponentSubType    = 'gm  ';
  246.  
  247.  
  248.  
  249. TYPE
  250.     MusicComponent                        = ComponentInstance;
  251. {  MusicSynthesizerFlags }
  252.  
  253. CONST
  254.     kSynthesizerDynamicVoice    = $01;                            {  can assign voices on the fly (else, polyphony is very important  }
  255.     kSynthesizerUsesMIDIPort    = $02;                            {  must be patched through MIDI Manager  }
  256.     kSynthesizerMicrotone        = $04;                            {  can play microtonal scales  }
  257.     kSynthesizerHasSamples        = $08;                            {  synthesizer has some use for sampled data  }
  258.     kSynthesizerMixedDrums        = $10;                            {  any part can play drum parts, total = instrument parts  }
  259.     kSynthesizerSoftware        = $20;                            {  implemented in main CPU software == uses cpu cycles  }
  260.     kSynthesizerHardware        = $40;                            {  is a hardware device (such as nubus, or maybe DSP?)  }
  261.     kSynthesizerDynamicChannel    = $80;                            {  can move any part to any channel or disable each part. (else we assume it lives on all channels in masks)  }
  262.     kSynthesizerHogsSystemChannel = $0100;                        {  can be channelwise dynamic, but always responds on its system channel  }
  263.     kSynthesizerHasSystemChannel = $0200;                        {  has some "system channel" notion to distinguish it from multiple instances of the same device (GM devices dont)  }
  264.     kSynthesizerSlowSetPart        = $0400;                        {  SetPart() and SetPartInstrumentNumber() calls do not have rapid response, may glitch notes  }
  265.     kSynthesizerOffline            = $1000;                        {  can enter an offline synthesis mode  }
  266.     kSynthesizerGM                = $4000;                        {  synth is a GM device  }
  267.     kSynthesizerDLS                = $8000;                        {  synth supports DLS level 1  }
  268.     kSynthesizerSoundLocalization = $00010000;                    {  synth supports extremely baroque, nonstandard, and proprietary "apple game sprockets" localization parameter set  }
  269.  
  270. {
  271.  * Note that these controller numbers
  272.  * are _not_ identical to the MIDI controller numbers.
  273.  * These are _signed_ 8.8 values, and the LSB's are
  274.  * always sent to a MIDI device. Controllers 32-63 are
  275.  * reserved (for MIDI, they are LSB's for 0-31, but we
  276.  * always send both).
  277.  *
  278.  * The full range, therefore, is -128.00 to 127.7f.
  279.  *
  280.  * _Excepting_ _volume_, all controls default to zero.
  281.  *
  282.  * Pitch bend is specified in fractional semitones! No
  283.  * more "pitch bend range" nonsense. You can bend as far
  284.  * as you want, any time you want.
  285.  }
  286.  
  287. TYPE
  288.     MusicController                        = SInt32;
  289.  
  290. CONST
  291.     kControllerModulationWheel    = 1;
  292.     kControllerBreath            = 2;
  293.     kControllerFoot                = 4;
  294.     kControllerPortamentoTime    = 5;                            {  time in 8.8 seconds, portamento on/off is omitted, 0 time = 'off'  }
  295.     kControllerVolume            = 7;                            {  main volume control  }
  296.     kControllerBalance            = 8;
  297.     kControllerPan                = 10;                            {  0 - "default", 1 - n: positioned in output 1-n (incl fractions)  }
  298.     kControllerExpression        = 11;                            {  secondary volume control  }
  299.     kControllerLever1            = 16;                            {  general purpose controllers  }
  300.     kControllerLever2            = 17;                            {  general purpose controllers  }
  301.     kControllerLever3            = 18;                            {  general purpose controllers  }
  302.     kControllerLever4            = 19;                            {  general purpose controllers  }
  303.     kControllerLever5            = 80;                            {  general purpose controllers  }
  304.     kControllerLever6            = 81;                            {  general purpose controllers  }
  305.     kControllerLever7            = 82;                            {  general purpose controllers  }
  306.     kControllerLever8            = 83;                            {  general purpose controllers  }
  307.     kControllerPitchBend        = 32;                            {  positive & negative semitones, with 8 bits fraction, same units as transpose controllers }
  308.     kControllerAfterTouch        = 33;                            {  aka channel pressure  }
  309.     kControllerPartTranspose    = 40;                            {  identical to pitchbend, for overall part xpose  }
  310.     kControllerTuneTranspose    = 41;                            {  another pitchbend, for "song global" pitch offset  }
  311.     kControllerPartVolume        = 42;                            {  another volume control, passed right down from note allocator part volume  }
  312.     kControllerTuneVolume        = 43;                            {  another volume control, used for "song global" volume - since we share one synthesizer across multiple tuneplayers }
  313.     kControllerSustain            = 64;                            {  boolean - positive for on, 0 or negative off  }
  314.     kControllerPortamento        = 65;                            {  boolean }
  315.     kControllerSostenuto        = 66;                            {  boolean  }
  316.     kControllerSoftPedal        = 67;                            {  boolean  }
  317.     kControllerReverb            = 91;
  318.     kControllerTremolo            = 92;
  319.     kControllerChorus            = 93;
  320.     kControllerCeleste            = 94;
  321.     kControllerPhaser            = 95;
  322.     kControllerEditPart            = 113;                            {  last 16 controllers 113-128 and above are global controllers which respond on part zero  }
  323.     kControllerMasterTune        = 114;
  324.     kControllerMasterTranspose    = 114;                            {  preferred }
  325.     kControllerMasterVolume        = 115;
  326.     kControllerMasterCPULoad    = 116;
  327.     kControllerMasterPolyphony    = 117;
  328.     kControllerMasterFeatures    = 118;
  329.  
  330.  
  331. {  ID's of knobs supported by the QuickTime Music Synthesizer built into QuickTime }
  332.  
  333.     kQTMSKnobStartID            = $02000000;
  334.     kQTMSKnobVolumeAttackTimeID    = $02000001;
  335.     kQTMSKnobVolumeDecayTimeID    = $02000002;
  336.     kQTMSKnobVolumeSustainLevelID = $02000003;
  337.     kQTMSKnobVolumeRelease1RateID = $02000004;
  338.     kQTMSKnobVolumeDecayKeyScalingID = $02000005;
  339.     kQTMSKnobVolumeReleaseTimeID = $02000006;
  340.     kQTMSKnobVolumeLFODelayID    = $02000007;
  341.     kQTMSKnobVolumeLFORampTimeID = $02000008;
  342.     kQTMSKnobVolumeLFOPeriodID    = $02000009;
  343.     kQTMSKnobVolumeLFOShapeID    = $0200000A;
  344.     kQTMSKnobVolumeLFODepthID    = $0200000B;
  345.     kQTMSKnobVolumeOverallID    = $0200000C;
  346.     kQTMSKnobVolumeVelocity127ID = $0200000D;
  347.     kQTMSKnobVolumeVelocity96ID    = $0200000E;
  348.     kQTMSKnobVolumeVelocity64ID    = $0200000F;
  349.     kQTMSKnobVolumeVelocity32ID    = $02000010;
  350.     kQTMSKnobVolumeVelocity16ID    = $02000011;                    {  Pitch related knobs }
  351.     kQTMSKnobPitchTransposeID    = $02000012;
  352.     kQTMSKnobPitchLFODelayID    = $02000013;
  353.     kQTMSKnobPitchLFORampTimeID    = $02000014;
  354.     kQTMSKnobPitchLFOPeriodID    = $02000015;
  355.     kQTMSKnobPitchLFOShapeID    = $02000016;
  356.     kQTMSKnobPitchLFODepthID    = $02000017;
  357.     kQTMSKnobPitchLFOQuantizeID    = $02000018;                    {  Stereo related knobs }
  358.     kQTMSKnobStereoDefaultPanID    = $02000019;
  359.     kQTMSKnobStereoPositionKeyScalingID = $0200001A;
  360.     kQTMSKnobPitchLFOOffsetID    = $0200001B;
  361.     kQTMSKnobExclusionGroupID    = $0200001C;                    {  Misc knobs, late additions }
  362.     kQTMSKnobSustainTimeID        = $0200001D;
  363.     kQTMSKnobSustainInfiniteID    = $0200001E;
  364.     kQTMSKnobVolumeLFOStereoID    = $0200001F;
  365.     kQTMSKnobVelocityLowID        = $02000020;
  366.     kQTMSKnobVelocityHighID        = $02000021;
  367.     kQTMSKnobVelocitySensitivityID = $02000022;
  368.     kQTMSKnobPitchSensitivityID    = $02000023;
  369.     kQTMSKnobVolumeLFODepthFromWheelID = $02000024;
  370.     kQTMSKnobPitchLFODepthFromWheelID = $02000025;                {  Volume Env again }
  371.     kQTMSKnobVolumeExpOptionsID    = $02000026;                    {  Env1 }
  372.     kQTMSKnobEnv1AttackTimeID    = $02000027;
  373.     kQTMSKnobEnv1DecayTimeID    = $02000028;
  374.     kQTMSKnobEnv1SustainLevelID    = $02000029;
  375.     kQTMSKnobEnv1SustainTimeID    = $0200002A;
  376.     kQTMSKnobEnv1SustainInfiniteID = $0200002B;
  377.     kQTMSKnobEnv1ReleaseTimeID    = $0200002C;
  378.     kQTMSKnobEnv1ExpOptionsID    = $0200002D;                    {  Env2 }
  379.     kQTMSKnobEnv2AttackTimeID    = $0200002E;
  380.     kQTMSKnobEnv2DecayTimeID    = $0200002F;
  381.     kQTMSKnobEnv2SustainLevelID    = $02000030;
  382.     kQTMSKnobEnv2SustainTimeID    = $02000031;
  383.     kQTMSKnobEnv2SustainInfiniteID = $02000032;
  384.     kQTMSKnobEnv2ReleaseTimeID    = $02000033;
  385.     kQTMSKnobEnv2ExpOptionsID    = $02000034;                    {  Pitch Env }
  386.     kQTMSKnobPitchEnvelopeID    = $02000035;
  387.     kQTMSKnobPitchEnvelopeDepthID = $02000036;                    {  Filter }
  388.     kQTMSKnobFilterKeyFollowID    = $02000037;
  389.     kQTMSKnobFilterTransposeID    = $02000038;
  390.     kQTMSKnobFilterQID            = $02000039;
  391.     kQTMSKnobFilterFrequencyEnvelopeID = $0200003A;
  392.     kQTMSKnobFilterFrequencyEnvelopeDepthID = $0200003B;
  393.     kQTMSKnobFilterQEnvelopeID    = $0200003C;
  394.     kQTMSKnobFilterQEnvelopeDepthID = $0200003D;                {  Reverb Threshhold }
  395.     kQTMSKnobReverbThresholdID    = $0200003E;
  396.     kQTMSKnobVolumeAttackVelScalingID = $0200003F;
  397.     kQTMSKnobLastIDPlus1        = $02000040;
  398.  
  399.  
  400.  
  401.  
  402.     kControllerMaximum            = $00007FFF;                    {  +01111111.11111111  }
  403.     kControllerMinimum            = $FFFF8000;                    {  -10000000.00000000  }
  404.  
  405.  
  406. TYPE
  407.     SynthesizerDescriptionPtr = ^SynthesizerDescription;
  408.     SynthesizerDescription = RECORD
  409.         synthesizerType:        OSType;                                    {  synthesizer type (must be same as component subtype)  }
  410.         name:                    Str31;                                    {  text name of synthesizer type  }
  411.         flags:                    UInt32;                                    {  from the above enum  }
  412.         voiceCount:                UInt32;                                    {  maximum polyphony  }
  413.         partCount:                UInt32;                                    {  maximum multi-timbrality (and midi channels)  }
  414.         instrumentCount:        UInt32;                                    {  non gm, built in (rom) instruments only  }
  415.         modifiableInstrumentCount: UInt32;                                {  plus n-more are user modifiable  }
  416.         channelMask:            UInt32;                                    {  (midi device only) which channels device always uses  }
  417.         drumPartCount:            UInt32;                                    {  maximum multi-timbrality of drum parts  }
  418.         drumCount:                UInt32;                                    {  non gm, built in (rom) drumkits only  }
  419.         modifiableDrumCount:    UInt32;                                    {  plus n-more are user modifiable  }
  420.         drumChannelMask:        UInt32;                                    {  (midi device only) which channels device always uses  }
  421.         outputCount:            UInt32;                                    {  number of audio outputs (usually two)  }
  422.         latency:                UInt32;                                    {  response time in µSec  }
  423.         controllers:            ARRAY [0..3] OF UInt32;                    {  array of 128 bits  }
  424.         gmInstruments:            ARRAY [0..3] OF UInt32;                    {  array of 128 bits  }
  425.         gmDrums:                ARRAY [0..3] OF UInt32;                    {  array of 128 bits  }
  426.     END;
  427.  
  428.  
  429. CONST
  430.     kVoiceCountDynamic            = -1;                            {  constant to use to specify dynamic voicing  }
  431.  
  432.  
  433.  
  434. TYPE
  435.     ToneDescriptionPtr = ^ToneDescription;
  436.     ToneDescription = RECORD
  437.         synthesizerType:        BigEndianOSType;                        {  synthesizer type  }
  438.         synthesizerName:        Str31;                                    {  name of instantiation of synth  }
  439.         instrumentName:            Str31;                                    {  preferred name for human use  }
  440.         instrumentNumber:        BigEndianLong;                            {  inst-number used if synth-name matches  }
  441.         gmNumber:                BigEndianLong;                            {  Best matching general MIDI number  }
  442.     END;
  443.  
  444.  
  445. CONST
  446.     kFirstGMInstrument            = $00000001;
  447.     kLastGMInstrument            = $00000080;
  448.     kFirstGSInstrument            = $00000081;
  449.     kLastGSInstrument            = $00003FFF;
  450.     kFirstDrumkit                = $00004000;                    {  (first value is "no drum". instrument numbers from 16384->16384+128 are drumkits, and for GM they are _defined_ drumkits!  }
  451.     kLastDrumkit                = $00004080;
  452.     kFirstROMInstrument            = $00008000;
  453.     kLastROMInstrument            = $0000FFFF;
  454.     kFirstUserInstrument        = $00010000;
  455.     kLastUserInstrument            = $0001FFFF;
  456.  
  457. {  InstrumentMatch }
  458.     kInstrumentMatchSynthesizerType = 1;
  459.     kInstrumentMatchSynthesizerName = 2;
  460.     kInstrumentMatchName        = 4;
  461.     kInstrumentMatchNumber        = 8;
  462.     kInstrumentMatchGMNumber    = 16;
  463.     kInstrumentMatchGSNumber    = 32;
  464.  
  465. {  KnobFlags }
  466.     kKnobBasic                    = 8;                            {  knob shows up in certain simplified lists of knobs  }
  467.     kKnobReadOnly                = 16;                            {  knob value cannot be changed by user or with a SetKnob call  }
  468.     kKnobInterruptUnsafe        = 32;                            {  only alter this knob from foreground task time (may access toolbox)  }
  469.     kKnobKeyrangeOverride        = 64;                            {  knob can be overridden within a single keyrange (software synth only)  }
  470.     kKnobGroupStart                = 128;                            {  knob is first in some logical group of knobs  }
  471.     kKnobFixedPoint8            = 1024;
  472.     kKnobFixedPoint16            = 2048;                            {  One of these may be used at a time.  }
  473.     kKnobTypeNumber                = $00;
  474.     kKnobTypeGroupName            = $1000;                        {  "knob" is really a group name for display purposes  }
  475.     kKnobTypeBoolean            = $2000;                        {  if range is greater than 1, its a multi-checkbox field  }
  476.     kKnobTypeNote                = $3000;                        {  knob range is equivalent to MIDI keys  }
  477.     kKnobTypePan                = $4000;                        {  range goes left/right (lose this? )  }
  478.     kKnobTypeInstrument            = $5000;                        {  knob value = reference to another instrument number  }
  479.     kKnobTypeSetting            = $6000;                        {  knob value is 1 of n different things (eg, fm algorithms) popup menu  }
  480.     kKnobTypeMilliseconds        = $7000;                        {  knob is a millisecond time range  }
  481.     kKnobTypePercentage            = $8000;                        {  knob range is displayed as a Percentage  }
  482.     kKnobTypeHertz                = $9000;                        {  knob represents frequency  }
  483.     kKnobTypeButton                = $A000;                        {  momentary trigger push button  }
  484.  
  485.  
  486.     kUnknownKnobValue            = $7FFFFFFF;                    {  a knob with this value means, we don't know it.  }
  487.     kDefaultKnobValue            = $7FFFFFFE;                    {  used to SET a knob to its default value.  }
  488.  
  489.  
  490. TYPE
  491.     KnobDescriptionPtr = ^KnobDescription;
  492.     KnobDescription = RECORD
  493.         name:                    Str63;
  494.         lowValue:                LONGINT;
  495.         highValue:                LONGINT;
  496.         defaultValue:            LONGINT;                                {  a default instrument is made of all default values  }
  497.         flags:                    LONGINT;
  498.         knobID:                    LONGINT;
  499.     END;
  500.  
  501.     GCInstrumentDataPtr = ^GCInstrumentData;
  502.     GCInstrumentData = RECORD
  503.         tone:                    ToneDescription;
  504.         knobCount:                LONGINT;
  505.         knob:                    ARRAY [0..0] OF LONGINT;
  506.     END;
  507.  
  508.     GCInstrumentDataHandle                = ^GCInstrumentDataPtr;
  509.     InstrumentAboutInfoPtr = ^InstrumentAboutInfo;
  510.     InstrumentAboutInfo = RECORD
  511.         p:                        PicHandle;
  512.         author:                    Str255;
  513.         copyright:                Str255;
  514.         other:                    Str255;
  515.     END;
  516.  
  517.  
  518.  
  519. CONST
  520.     notImplementedMusicErr        = $8000F7E9;
  521.     cantSendToSynthesizerErr    = $8000F7E8;
  522.     cantReceiveFromSynthesizerErr = $8000F7E7;
  523.     illegalVoiceAllocationErr    = $8000F7E6;
  524.     illegalPartErr                = $8000F7E5;
  525.     illegalChannelErr            = $8000F7E4;
  526.     illegalKnobErr                = $8000F7E3;
  527.     illegalKnobValueErr            = $8000F7E2;
  528.     illegalInstrumentErr        = $8000F7E1;
  529.     illegalControllerErr        = $8000F7E0;
  530.     midiManagerAbsentErr        = $8000F7DF;
  531.     synthesizerNotRespondingErr    = $8000F7DE;
  532.     synthesizerErr                = $8000F7DD;
  533.     illegalNoteChannelErr        = $8000F7DC;
  534.     noteChannelNotAllocatedErr    = $8000F7DB;
  535.     tunePlayerFullErr            = $8000F7DA;
  536.     tuneParseErr                = $8000F7D9;
  537.  
  538.     kGetAtomicInstNoExpandedSamples = $01;
  539.     kGetAtomicInstNoOriginalSamples = $02;
  540.     kGetAtomicInstNoSamples        = $03;
  541.     kGetAtomicInstNoKnobList    = $04;
  542.     kGetAtomicInstNoInstrumentInfo = $08;
  543.     kGetAtomicInstOriginalKnobList = $10;
  544.     kGetAtomicInstAllKnobs        = $20;                            {  return even those that are set to default }
  545.  
  546. {
  547.    For non-gm instruments, instrument number of tone description == 0
  548.    If you want to speed up while running, slam the inst num with what Get instrument number returns
  549.    All missing knobs are slammed to the default value
  550. }
  551.     kSetAtomicInstKeepOriginalInstrument = $01;
  552.     kSetAtomicInstShareAcrossParts = $02;                        {  inst disappears when app goes away }
  553.     kSetAtomicInstCallerTosses    = $04;                            {  the caller isn't keeping a copy around (for NASetAtomicInstrument) }
  554.     kSetAtomicInstCallerGuarantees = $08;                        {  the caller guarantees a copy is around }
  555.     kSetAtomicInstInterruptSafe    = $10;                            {  dont move memory at this time (but process at next task time) }
  556.     kSetAtomicInstDontPreprocess = $80;                            {  perform no further preprocessing because either 1)you know the instrument is digitally clean, or 2) you got it from a GetPartAtomic }
  557.  
  558.     kInstrumentNamesModifiable    = 1;
  559.     kInstrumentNamesBoth        = 2;
  560.  
  561. {
  562.  * Structures specific to the GenericMusicComponent
  563.  }
  564.  
  565.     kGenericMusicComponentSubtype = 'gene';
  566.  
  567.  
  568. TYPE
  569.     GenericKnobDescriptionPtr = ^GenericKnobDescription;
  570.     GenericKnobDescription = RECORD
  571.         kd:                        KnobDescription;
  572.         hw1:                    LONGINT;                                {  driver defined  }
  573.         hw2:                    LONGINT;                                {  driver defined  }
  574.         hw3:                    LONGINT;                                {  driver defined  }
  575.         settingsID:                LONGINT;                                {  resource ID list for boolean and popup names  }
  576.     END;
  577.  
  578.     GenericKnobDescriptionListPtr = ^GenericKnobDescriptionList;
  579.     GenericKnobDescriptionList = RECORD
  580.         knobCount:                LONGINT;
  581.         knob:                    ARRAY [0..0] OF GenericKnobDescription;
  582.     END;
  583.  
  584.     GenericKnobDescriptionListHandle    = ^GenericKnobDescriptionListPtr;
  585. { knobTypes for MusicDerivedSetKnob }
  586.  
  587. CONST
  588.     kGenericMusicKnob            = 1;
  589.     kGenericMusicInstrumentKnob    = 2;
  590.     kGenericMusicDrumKnob        = 3;
  591.     kGenericMusicGlobalController = 4;
  592.  
  593.  
  594.  
  595.     kGenericMusicResFirst        = 0;
  596.     kGenericMusicResMiscStringList = 1;                            {  STR# 1: synth name, 2:about author,3:aboutcopyright,4:aboutother  }
  597.     kGenericMusicResMiscLongList = 2;                            {  Long various params, see list below  }
  598.     kGenericMusicResInstrumentList = 3;                            {  NmLs of names and shorts, categories prefixed by '••'  }
  599.     kGenericMusicResDrumList    = 4;                            {  NmLs of names and shorts  }
  600.     kGenericMusicResInstrumentKnobDescriptionList = 5;            {  Knob  }
  601.     kGenericMusicResDrumKnobDescriptionList = 6;                {  Knob  }
  602.     kGenericMusicResKnobDescriptionList = 7;                    {  Knob  }
  603.     kGenericMusicResBitsLongList = 8;                            {  Long back to back bitmaps of controllers, gminstruments, and drums  }
  604.     kGenericMusicResModifiableInstrumentHW = 9;                    {  Shrt same as the hw shorts trailing the instrument names, a shortlist  }
  605.     kGenericMusicResGMTranslation = 10;                            {  Long 128 long entries, 1 for each gm inst, of local instrument numbers 1-n (not hw numbers)  }
  606.     kGenericMusicResROMInstrumentData = 11;                        {  knob lists for ROM instruments, so the knob values may be known  }
  607.     kGenericMusicResAboutPICT    = 12;                            {  picture for aboutlist. must be present for GetAbout call to work  }
  608.     kGenericMusicResLast        = 13;
  609.  
  610. { elements of the misc long list }
  611.     kGenericMusicMiscLongFirst    = 0;
  612.     kGenericMusicMiscLongVoiceCount = 1;
  613.     kGenericMusicMiscLongPartCount = 2;
  614.     kGenericMusicMiscLongModifiableInstrumentCount = 3;
  615.     kGenericMusicMiscLongChannelMask = 4;
  616.     kGenericMusicMiscLongDrumPartCount = 5;
  617.     kGenericMusicMiscLongModifiableDrumCount = 6;
  618.     kGenericMusicMiscLongDrumChannelMask = 7;
  619.     kGenericMusicMiscLongOutputCount = 8;
  620.     kGenericMusicMiscLongLatency = 9;
  621.     kGenericMusicMiscLongFlags    = 10;
  622.     kGenericMusicMiscLongFirstGMHW = 11;                        {  number to add to locate GM main instruments  }
  623.     kGenericMusicMiscLongFirstGMDrumHW = 12;                    {  number to add to locate GM drumkits  }
  624.     kGenericMusicMiscLongFirstUserHW = 13;                        {  First hw number of user instruments (presumed sequential)  }
  625.     kGenericMusicMiscLongLast    = 14;
  626.  
  627.  
  628. TYPE
  629.     GCPartPtr = ^GCPart;
  630.     GCPart = RECORD
  631.         hwInstrumentNumber:        LONGINT;                                {  internal number of recalled instrument  }
  632.         controller:                ARRAY [0..127] OF INTEGER;                {  current values for all controllers  }
  633.         volume:                    LONGINT;                                {  ctrl 7 is special case  }
  634.         polyphony:                LONGINT;
  635.         midiChannel:            LONGINT;                                {  1-16 if in use  }
  636.         id:                        GCInstrumentData;                        {  ToneDescription & knoblist, uncertain length  }
  637.     END;
  638.  
  639. {
  640.  * Calls specific to the GenericMusicComponent
  641.  }
  642.  
  643. CONST
  644.     kMusicGenericRange            = $0100;
  645.     kMusicDerivedRange            = $0200;
  646.  
  647. {
  648.  * Flags in GenericMusicConfigure call
  649.  }
  650.     kGenericMusicDoMIDI            = $01;                            {  implement normal MIDI messages for note, controllers, and program changes 0-127  }
  651.     kGenericMusicBank0            = $02;                            {  implement instrument bank changes on controller 0  }
  652.     kGenericMusicBank32            = $04;                            {  implement instrument bank changes on controller 32  }
  653.     kGenericMusicErsatzMIDI        = $08;                            {  construct MIDI packets, but send them to the derived component  }
  654.     kGenericMusicCallKnobs        = $10;                            {  call the derived component with special knob format call  }
  655.     kGenericMusicCallParts        = $20;                            {  call the derived component with special part format call  }
  656.     kGenericMusicCallInstrument    = $40;                            {  call MusicDerivedSetInstrument for MusicSetInstrument calls  }
  657.     kGenericMusicCallNumber        = $80;                            {  call MusicDerivedSetPartInstrumentNumber for MusicSetPartInstrumentNumber calls, & don't send any C0 or bank stuff  }
  658.     kGenericMusicCallROMInstrument = $0100;                        {  call MusicSetInstrument for MusicSetPartInstrumentNumber for "ROM" instruments, passing params from the ROMi resource  }
  659.     kGenericMusicAllDefaults    = $0200;                        {  indicates that when a new instrument is recalled, all knobs are reset to DEFAULT settings. True for GS modules  }
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666. TYPE
  667. {$IFC TYPED_FUNCTION_POINTERS}
  668.     MusicOfflineDataProcPtr = FUNCTION(SoundData: Ptr; numBytes: LONGINT; myRefCon: LONGINT): ComponentResult;
  669. {$ELSEC}
  670.     MusicOfflineDataProcPtr = ProcPtr;
  671. {$ENDC}
  672.  
  673.     MusicOfflineDataUPP = UniversalProcPtr;
  674.     OfflineSampleTypePtr = ^OfflineSampleType;
  675.     OfflineSampleType = RECORD
  676.         numChannels:            UInt32;                                    { number of channels,  ie mono = 1 }
  677.         sampleRate:                UnsignedFixed;                            { sample rate in Apples Fixed point representation }
  678.         sampleSize:                UInt16;                                    { number of bits in sample }
  679.     END;
  680.  
  681.     InstrumentInfoRecordPtr = ^InstrumentInfoRecord;
  682.     InstrumentInfoRecord = RECORD
  683.         instrumentNumber:        LONGINT;                                {  instrument number (if 0, name is a catagory) }
  684.         flags:                    LONGINT;                                {  show in picker, etc. }
  685.         toneNameIndex:            LONGINT;                                {  index in toneNames (1 based) }
  686.         itxtNameAtomID:            LONGINT;                                {  index in itxtNames (itxt/name by index) }
  687.     END;
  688.  
  689.     InstrumentInfoListPtr = ^InstrumentInfoList;
  690.     InstrumentInfoList = RECORD
  691.         recordCount:            LONGINT;
  692.         toneNames:                Handle;                                    {  name from tone description }
  693.         itxtNames:                QTAtomContainer;                        {  itxt/name atoms for instruments }
  694.         info:                    ARRAY [0..0] OF InstrumentInfoRecord;
  695.     END;
  696.  
  697.     InstrumentInfoListHandle            = ^InstrumentInfoListPtr;
  698. FUNCTION MusicGetDescription(mc: MusicComponent; VAR sd: SynthesizerDescription): ComponentResult;
  699.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  700.     INLINE $2F3C, $0004, $0001, $7000, $A82A;
  701.     {$ENDC}
  702. FUNCTION MusicGetPart(mc: MusicComponent; part: LONGINT; VAR midiChannel: LONGINT; VAR polyphony: LONGINT): ComponentResult;
  703.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  704.     INLINE $2F3C, $000C, $0002, $7000, $A82A;
  705.     {$ENDC}
  706. FUNCTION MusicSetPart(mc: MusicComponent; part: LONGINT; midiChannel: LONGINT; polyphony: LONGINT): ComponentResult;
  707.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  708.     INLINE $2F3C, $000C, $0003, $7000, $A82A;
  709.     {$ENDC}
  710. FUNCTION MusicSetPartInstrumentNumber(mc: MusicComponent; part: LONGINT; instrumentNumber: LONGINT): ComponentResult;
  711.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  712.     INLINE $2F3C, $0008, $0004, $7000, $A82A;
  713.     {$ENDC}
  714.  
  715. FUNCTION MusicGetPartInstrumentNumber(mc: MusicComponent; part: LONGINT): ComponentResult;
  716.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  717.     INLINE $2F3C, $0004, $0005, $7000, $A82A;
  718.     {$ENDC}
  719. FUNCTION MusicStorePartInstrument(mc: MusicComponent; part: LONGINT; instrumentNumber: LONGINT): ComponentResult;
  720.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  721.     INLINE $2F3C, $0008, $0006, $7000, $A82A;
  722.     {$ENDC}
  723.  
  724. FUNCTION MusicGetPartAtomicInstrument(mc: MusicComponent; part: LONGINT; VAR ai: AtomicInstrument; flags: LONGINT): ComponentResult;
  725.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  726.     INLINE $2F3C, $000C, $0009, $7000, $A82A;
  727.     {$ENDC}
  728. FUNCTION MusicSetPartAtomicInstrument(mc: MusicComponent; part: LONGINT; aiP: AtomicInstrumentPtr; flags: LONGINT): ComponentResult;
  729.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  730.     INLINE $2F3C, $000C, $000A, $7000, $A82A;
  731.     {$ENDC}
  732.  
  733. {  Obsolete calls }
  734. FUNCTION MusicGetInstrumentKnobDescriptionObsolete(mc: MusicComponent; knobIndex: LONGINT; mkd: UNIV Ptr): ComponentResult;
  735.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  736.     INLINE $2F3C, $0008, $000D, $7000, $A82A;
  737.     {$ENDC}
  738. FUNCTION MusicGetDrumKnobDescriptionObsolete(mc: MusicComponent; knobIndex: LONGINT; mkd: UNIV Ptr): ComponentResult;
  739.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  740.     INLINE $2F3C, $0008, $000E, $7000, $A82A;
  741.     {$ENDC}
  742. FUNCTION MusicGetKnobDescriptionObsolete(mc: MusicComponent; knobIndex: LONGINT; mkd: UNIV Ptr): ComponentResult;
  743.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  744.     INLINE $2F3C, $0008, $000F, $7000, $A82A;
  745.     {$ENDC}
  746. FUNCTION MusicGetPartKnob(mc: MusicComponent; part: LONGINT; knobID: LONGINT): ComponentResult;
  747.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  748.     INLINE $2F3C, $0008, $0010, $7000, $A82A;
  749.     {$ENDC}
  750. FUNCTION MusicSetPartKnob(mc: MusicComponent; part: LONGINT; knobID: LONGINT; knobValue: LONGINT): ComponentResult;
  751.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  752.     INLINE $2F3C, $000C, $0011, $7000, $A82A;
  753.     {$ENDC}
  754. FUNCTION MusicGetKnob(mc: MusicComponent; knobID: LONGINT): ComponentResult;
  755.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  756.     INLINE $2F3C, $0004, $0012, $7000, $A82A;
  757.     {$ENDC}
  758. FUNCTION MusicSetKnob(mc: MusicComponent; knobID: LONGINT; knobValue: LONGINT): ComponentResult;
  759.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  760.     INLINE $2F3C, $0008, $0013, $7000, $A82A;
  761.     {$ENDC}
  762. FUNCTION MusicGetPartName(mc: MusicComponent; part: LONGINT; name: StringPtr): ComponentResult;
  763.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  764.     INLINE $2F3C, $0008, $0014, $7000, $A82A;
  765.     {$ENDC}
  766. FUNCTION MusicSetPartName(mc: MusicComponent; part: LONGINT; name: StringPtr): ComponentResult;
  767.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  768.     INLINE $2F3C, $0008, $0015, $7000, $A82A;
  769.     {$ENDC}
  770. FUNCTION MusicFindTone(mc: MusicComponent; VAR td: ToneDescription; VAR libraryIndexOut: LONGINT; VAR fit: UInt32): ComponentResult;
  771.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  772.     INLINE $2F3C, $000C, $0016, $7000, $A82A;
  773.     {$ENDC}
  774. FUNCTION MusicPlayNote(mc: MusicComponent; part: LONGINT; pitch: LONGINT; velocity: LONGINT): ComponentResult;
  775.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  776.     INLINE $2F3C, $000C, $0017, $7000, $A82A;
  777.     {$ENDC}
  778. FUNCTION MusicResetPart(mc: MusicComponent; part: LONGINT): ComponentResult;
  779.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  780.     INLINE $2F3C, $0004, $0018, $7000, $A82A;
  781.     {$ENDC}
  782. FUNCTION MusicSetPartController(mc: MusicComponent; part: LONGINT; controllerNumber: MusicController; controllerValue: LONGINT): ComponentResult;
  783.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  784.     INLINE $2F3C, $000C, $0019, $7000, $A82A;
  785.     {$ENDC}
  786.  
  787. FUNCTION MusicGetPartController(mc: MusicComponent; part: LONGINT; controllerNumber: MusicController): ComponentResult;
  788.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  789.     INLINE $2F3C, $0008, $001A, $7000, $A82A;
  790.     {$ENDC}
  791. FUNCTION MusicGetMIDIProc(mc: MusicComponent; VAR midiSendProc: MusicMIDISendUPP; VAR refCon: LONGINT): ComponentResult;
  792.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  793.     INLINE $2F3C, $0008, $001B, $7000, $A82A;
  794.     {$ENDC}
  795. FUNCTION MusicSetMIDIProc(mc: MusicComponent; midiSendProc: MusicMIDISendUPP; refCon: LONGINT): ComponentResult;
  796.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  797.     INLINE $2F3C, $0008, $001C, $7000, $A82A;
  798.     {$ENDC}
  799. FUNCTION MusicGetInstrumentNames(mc: MusicComponent; modifiableInstruments: LONGINT; VAR instrumentNames: Handle; VAR instrumentCategoryLasts: Handle; VAR instrumentCategoryNames: Handle): ComponentResult;
  800.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  801.     INLINE $2F3C, $0010, $001D, $7000, $A82A;
  802.     {$ENDC}
  803. FUNCTION MusicGetDrumNames(mc: MusicComponent; modifiableInstruments: LONGINT; VAR instrumentNumbers: Handle; VAR instrumentNames: Handle): ComponentResult;
  804.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  805.     INLINE $2F3C, $000C, $001E, $7000, $A82A;
  806.     {$ENDC}
  807. FUNCTION MusicGetMasterTune(mc: MusicComponent): ComponentResult;
  808.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  809.     INLINE $2F3C, $0000, $001F, $7000, $A82A;
  810.     {$ENDC}
  811. FUNCTION MusicSetMasterTune(mc: MusicComponent; masterTune: LONGINT): ComponentResult;
  812.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  813.     INLINE $2F3C, $0004, $0020, $7000, $A82A;
  814.     {$ENDC}
  815.  
  816. FUNCTION MusicGetInstrumentAboutInfo(mc: MusicComponent; part: LONGINT; VAR iai: InstrumentAboutInfo): ComponentResult;
  817.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  818.     INLINE $2F3C, $0008, $0022, $7000, $A82A;
  819.     {$ENDC}
  820. FUNCTION MusicGetDeviceConnection(mc: MusicComponent; index: LONGINT; VAR id1: LONGINT; VAR id2: LONGINT): ComponentResult;
  821.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  822.     INLINE $2F3C, $000C, $0023, $7000, $A82A;
  823.     {$ENDC}
  824. FUNCTION MusicUseDeviceConnection(mc: MusicComponent; id1: LONGINT; id2: LONGINT): ComponentResult;
  825.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  826.     INLINE $2F3C, $0008, $0024, $7000, $A82A;
  827.     {$ENDC}
  828. FUNCTION MusicGetKnobSettingStrings(mc: MusicComponent; knobIndex: LONGINT; isGlobal: LONGINT; VAR settingsNames: Handle; VAR settingsCategoryLasts: Handle; VAR settingsCategoryNames: Handle): ComponentResult;
  829.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  830.     INLINE $2F3C, $0014, $0025, $7000, $A82A;
  831.     {$ENDC}
  832. FUNCTION MusicGetMIDIPorts(mc: MusicComponent; VAR inputPortCount: LONGINT; VAR outputPortCount: LONGINT): ComponentResult;
  833.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  834.     INLINE $2F3C, $0008, $0026, $7000, $A82A;
  835.     {$ENDC}
  836. FUNCTION MusicSendMIDI(mc: MusicComponent; portIndex: LONGINT; VAR mp: MusicMIDIPacket): ComponentResult;
  837.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  838.     INLINE $2F3C, $0008, $0027, $7000, $A82A;
  839.     {$ENDC}
  840. FUNCTION MusicReceiveMIDI(mc: MusicComponent; readHook: MusicMIDIReadHookUPP; refCon: LONGINT): ComponentResult;
  841.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  842.     INLINE $2F3C, $0008, $0028, $7000, $A82A;
  843.     {$ENDC}
  844. FUNCTION MusicStartOffline(mc: MusicComponent; VAR numChannels: UInt32; VAR sampleRate: UnsignedFixed; VAR sampleSize: UInt16; dataProc: MusicOfflineDataUPP; dataProcRefCon: LONGINT): ComponentResult;
  845.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  846.     INLINE $2F3C, $0014, $0029, $7000, $A82A;
  847.     {$ENDC}
  848. FUNCTION MusicSetOfflineTimeTo(mc: MusicComponent; newTimeStamp: LONGINT): ComponentResult;
  849.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  850.     INLINE $2F3C, $0004, $002A, $7000, $A82A;
  851.     {$ENDC}
  852. FUNCTION MusicGetInstrumentKnobDescription(mc: MusicComponent; knobIndex: LONGINT; VAR mkd: KnobDescription): ComponentResult;
  853.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  854.     INLINE $2F3C, $0008, $002B, $7000, $A82A;
  855.     {$ENDC}
  856. FUNCTION MusicGetDrumKnobDescription(mc: MusicComponent; knobIndex: LONGINT; VAR mkd: KnobDescription): ComponentResult;
  857.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  858.     INLINE $2F3C, $0008, $002C, $7000, $A82A;
  859.     {$ENDC}
  860. FUNCTION MusicGetKnobDescription(mc: MusicComponent; knobIndex: LONGINT; VAR mkd: KnobDescription): ComponentResult;
  861.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  862.     INLINE $2F3C, $0008, $002D, $7000, $A82A;
  863.     {$ENDC}
  864. FUNCTION MusicGetInfoText(mc: MusicComponent; selector: LONGINT; VAR textH: Handle; VAR styleH: Handle): ComponentResult;
  865.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  866.     INLINE $2F3C, $000C, $002E, $7000, $A82A;
  867.     {$ENDC}
  868.  
  869. CONST
  870.     kGetInstrumentInfoNoBuiltIn    = $01;
  871.     kGetInstrumentInfoMidiUserInst = $02;
  872.     kGetInstrumentInfoNoIText    = $04;
  873.  
  874. FUNCTION MusicGetInstrumentInfo(mc: MusicComponent; getInstrumentInfoFlags: LONGINT; VAR infoListH: InstrumentInfoListHandle): ComponentResult;
  875.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  876.     INLINE $2F3C, $0008, $002F, $7000, $A82A;
  877.     {$ENDC}
  878.  
  879.  
  880.  
  881. FUNCTION MusicTask(mc: MusicComponent): ComponentResult;
  882.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  883.     INLINE $2F3C, $0000, $0031, $7000, $A82A;
  884.     {$ENDC}
  885. FUNCTION MusicSetPartInstrumentNumberInterruptSafe(mc: MusicComponent; part: LONGINT; instrumentNumber: LONGINT): ComponentResult;
  886.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  887.     INLINE $2F3C, $0008, $0032, $7000, $A82A;
  888.     {$ENDC}
  889. FUNCTION MusicSetPartSoundLocalization(mc: MusicComponent; part: LONGINT; data: Handle): ComponentResult;
  890.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  891.     INLINE $2F3C, $0008, $0033, $7000, $A82A;
  892.     {$ENDC}
  893. FUNCTION MusicGenericConfigure(mc: MusicComponent; mode: LONGINT; flags: LONGINT; baseResID: LONGINT): ComponentResult;
  894.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  895.     INLINE $2F3C, $000C, $0100, $7000, $A82A;
  896.     {$ENDC}
  897. FUNCTION MusicGenericGetPart(mc: MusicComponent; partNumber: LONGINT; VAR part: GCPartPtr): ComponentResult;
  898.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  899.     INLINE $2F3C, $0008, $0101, $7000, $A82A;
  900.     {$ENDC}
  901. FUNCTION MusicGenericGetKnobList(mc: MusicComponent; knobType: LONGINT; VAR gkdlH: GenericKnobDescriptionListHandle): ComponentResult;
  902.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  903.     INLINE $2F3C, $0008, $0102, $7000, $A82A;
  904.     {$ENDC}
  905. FUNCTION MusicGenericSetResourceNumbers(mc: MusicComponent; resourceIDH: Handle): ComponentResult;
  906.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  907.     INLINE $2F3C, $0004, $0103, $7000, $A82A;
  908.     {$ENDC}
  909. FUNCTION MusicDerivedMIDISend(mc: MusicComponent; VAR packet: MusicMIDIPacket): ComponentResult;
  910.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  911.     INLINE $2F3C, $0004, $0200, $7000, $A82A;
  912.     {$ENDC}
  913. FUNCTION MusicDerivedSetKnob(mc: MusicComponent; knobType: LONGINT; knobNumber: LONGINT; knobValue: LONGINT; partNumber: LONGINT; VAR p: GCPart; VAR gkd: GenericKnobDescription): ComponentResult;
  914.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  915.     INLINE $2F3C, $0018, $0201, $7000, $A82A;
  916.     {$ENDC}
  917. FUNCTION MusicDerivedSetPart(mc: MusicComponent; partNumber: LONGINT; VAR p: GCPart): ComponentResult;
  918.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  919.     INLINE $2F3C, $0008, $0202, $7000, $A82A;
  920.     {$ENDC}
  921. FUNCTION MusicDerivedSetInstrument(mc: MusicComponent; partNumber: LONGINT; VAR p: GCPart): ComponentResult;
  922.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  923.     INLINE $2F3C, $0008, $0203, $7000, $A82A;
  924.     {$ENDC}
  925. FUNCTION MusicDerivedSetPartInstrumentNumber(mc: MusicComponent; partNumber: LONGINT; VAR p: GCPart): ComponentResult;
  926.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  927.     INLINE $2F3C, $0008, $0204, $7000, $A82A;
  928.     {$ENDC}
  929. FUNCTION MusicDerivedSetMIDI(mc: MusicComponent; midiProc: MusicMIDISendUPP; refcon: LONGINT; midiChannel: LONGINT): ComponentResult;
  930.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  931.     INLINE $2F3C, $000C, $0205, $7000, $A82A;
  932.     {$ENDC}
  933. FUNCTION MusicDerivedStorePartInstrument(mc: MusicComponent; partNumber: LONGINT; VAR p: GCPart; instrumentNumber: LONGINT): ComponentResult;
  934.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  935.     INLINE $2F3C, $000C, $0206, $7000, $A82A;
  936.     {$ENDC}
  937. FUNCTION MusicDerivedOpenResFile(mc: MusicComponent): ComponentResult;
  938.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  939.     INLINE $2F3C, $0000, $0207, $7000, $A82A;
  940.     {$ENDC}
  941. FUNCTION MusicDerivedCloseResFile(mc: MusicComponent; resRefNum: INTEGER): ComponentResult;
  942.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  943.     INLINE $2F3C, $0002, $0208, $7000, $A82A;
  944.     {$ENDC}
  945.  
  946.  
  947.  
  948.  
  949.  
  950. {  Mask bit for returned value by InstrumentFind. }
  951.  
  952. CONST
  953.     kInstrumentExactMatch        = $00020000;
  954.     kInstrumentRecommendedSubstitute = $00010000;
  955.     kInstrumentQualityField        = $FF000000;
  956.     kInstrumentRoland8BitQuality = $05000000;
  957.  
  958.  
  959. TYPE
  960.     InstrumentAboutInfoHandle            = ^InstrumentAboutInfoPtr;
  961.     GMInstrumentInfoPtr = ^GMInstrumentInfo;
  962.     GMInstrumentInfo = RECORD
  963.         cmpInstID:                LONGINT;
  964.         gmInstNum:                LONGINT;
  965.         instMatch:                LONGINT;
  966.     END;
  967.  
  968.     GMInstrumentInfoHandle                = ^GMInstrumentInfoPtr;
  969.     nonGMInstrumentInfoRecordPtr = ^nonGMInstrumentInfoRecord;
  970.     nonGMInstrumentInfoRecord = RECORD
  971.         cmpInstID:                LONGINT;                                {  if 0, category name }
  972.         flags:                    LONGINT;                                {  match, show in picker }
  973.         toneNameIndex:            LONGINT;                                {  index in toneNames (1 based) }
  974.         itxtNameAtomID:            LONGINT;                                {  index in itxtNames (itxt/name by index) }
  975.     END;
  976.  
  977.     nonGMInstrumentInfoPtr = ^nonGMInstrumentInfo;
  978.     nonGMInstrumentInfo = RECORD
  979.         recordCount:            LONGINT;
  980.         toneNames:                Handle;                                    {  name from tone description }
  981.         itxtNames:                QTAtomContainer;                        {  itext/name atoms for instruments }
  982.         instInfo:                ARRAY [0..0] OF nonGMInstrumentInfoRecord;
  983.     END;
  984.  
  985.     nonGMInstrumentInfoHandle            = ^nonGMInstrumentInfoPtr;
  986.     InstCompInfoPtr = ^InstCompInfo;
  987.     InstCompInfo = RECORD
  988.         infoSize:                LONGINT;                                {  size of this record }
  989.         InstrumentLibraryName:    Str31;
  990.         InstrumentLibraryITxt:    QTAtomContainer;                        {  itext/name atoms for instruments }
  991.         GMinstrumentCount:        LONGINT;
  992.         GMinstrumentInfo:        GMInstrumentInfoHandle;
  993.         GMdrumCount:            LONGINT;
  994.         GMdrumInfo:                GMInstrumentInfoHandle;
  995.         nonGMinstrumentCount:    LONGINT;
  996.         nonGMinstrumentInfo:    nonGMInstrumentInfoHandle;
  997.     END;
  998.  
  999.     InstCompInfoHandle                    = ^InstCompInfoPtr;
  1000. FUNCTION InstrumentGetInst(ci: ComponentInstance; instID: LONGINT; VAR atomicInst: AtomicInstrument; flags: LONGINT): ComponentResult;
  1001.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1002.     INLINE $2F3C, $000C, $0001, $7000, $A82A;
  1003.     {$ENDC}
  1004. FUNCTION InstrumentGetInfo(ci: ComponentInstance; getInstrumentInfoFlags: LONGINT; VAR instInfo: InstCompInfoHandle): ComponentResult;
  1005.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1006.     INLINE $2F3C, $0008, $0002, $7000, $A82A;
  1007.     {$ENDC}
  1008. FUNCTION InstrumentInitialize(ci: ComponentInstance; initFormat: LONGINT; initParams: UNIV Ptr): ComponentResult;
  1009.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1010.     INLINE $2F3C, $0008, $0003, $7000, $A82A;
  1011.     {$ENDC}
  1012. FUNCTION InstrumentOpenComponentResFile(ci: ComponentInstance; VAR resFile: INTEGER): ComponentResult;
  1013.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1014.     INLINE $2F3C, $0004, $0004, $7000, $A82A;
  1015.     {$ENDC}
  1016. FUNCTION InstrumentCloseComponentResFile(ci: ComponentInstance; resFile: INTEGER): ComponentResult;
  1017.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1018.     INLINE $2F3C, $0002, $0005, $7000, $A82A;
  1019.     {$ENDC}
  1020. FUNCTION InstrumentGetComponentRefCon(ci: ComponentInstance; VAR refCon: UNIV Ptr): ComponentResult;
  1021.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1022.     INLINE $2F3C, $0004, $0006, $7000, $A82A;
  1023.     {$ENDC}
  1024. FUNCTION InstrumentSetComponentRefCon(ci: ComponentInstance; refCon: UNIV Ptr): ComponentResult;
  1025.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1026.     INLINE $2F3C, $0004, $0007, $7000, $A82A;
  1027.     {$ENDC}
  1028. FUNCTION InstrumentGetSynthesizerType(ci: ComponentInstance; VAR synthesizerType: OSType): ComponentResult;
  1029.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1030.     INLINE $2F3C, $0004, $0008, $7000, $A82A;
  1031.     {$ENDC}
  1032.  
  1033.  
  1034. {--------------------------
  1035.     Types
  1036. --------------------------}
  1037.  
  1038. CONST
  1039.     kNoteRequestNoGM            = 1;                            {  dont degrade to a GM synth  }
  1040.     kNoteRequestNoSynthType        = 2;                            {  dont degrade to another synth of same type but different name  }
  1041.     kNoteRequestSynthMustMatch    = 4;                            {  synthType must be a match, including kGMSynthComponentSubType  }
  1042.  
  1043.  
  1044. TYPE
  1045.     NoteAllocator                        = ComponentInstance;
  1046.     NoteRequestInfoPtr = ^NoteRequestInfo;
  1047.     NoteRequestInfo = RECORD
  1048.         flags:                    SInt8;                                    {  1: dont accept GM match, 2: dont accept same-synth-type match  }
  1049.         reserved:                SInt8;                                    {  must be zero  }
  1050.         polyphony:                BigEndianShort;                            {  Maximum number of voices  }
  1051.         typicalPolyphony:        BigEndianFixed;                            {  Hint for level mixing  }
  1052.     END;
  1053.  
  1054.     NoteRequestPtr = ^NoteRequest;
  1055.     NoteRequest = RECORD
  1056.         info:                    NoteRequestInfo;
  1057.         tone:                    ToneDescription;
  1058.     END;
  1059.  
  1060.     NoteChannel = ^LONGINT;
  1061.  
  1062.  
  1063.  
  1064. CONST
  1065.     kPickDontMix                = 1;                            {  dont mix instruments with drum sounds  }
  1066.     kPickSameSynth                = 2;                            {  only allow the same device that went in, to come out  }
  1067.     kPickUserInsts                = 4;                            {  show user insts in addition to ROM voices  }
  1068.     kPickEditAllowEdit            = 8;                            {  lets user switch over to edit mode  }
  1069.     kPickEditAllowPick            = 16;                            {  lets the user switch over to pick mode  }
  1070.     kPickEditSynthGlobal        = 32;                            {  edit the global knobs of the synth  }
  1071.     kPickEditControllers        = 64;                            {  edit the controllers of the notechannel  }
  1072.  
  1073.  
  1074.     kNoteAllocatorComponentType    = 'nota';
  1075.  
  1076.  
  1077. {--------------------------------
  1078.     Note Allocator Prototypes
  1079. --------------------------------}
  1080. FUNCTION NARegisterMusicDevice(na: NoteAllocator; synthType: OSType; VAR name: Str31; VAR connections: SynthesizerConnections): ComponentResult;
  1081.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1082.     INLINE $2F3C, $000C, $0000, $7000, $A82A;
  1083.     {$ENDC}
  1084. FUNCTION NAUnregisterMusicDevice(na: NoteAllocator; index: LONGINT): ComponentResult;
  1085.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1086.     INLINE $2F3C, $0004, $0001, $7000, $A82A;
  1087.     {$ENDC}
  1088. FUNCTION NAGetRegisteredMusicDevice(na: NoteAllocator; index: LONGINT; VAR synthType: OSType; VAR name: Str31; VAR connections: SynthesizerConnections; VAR mc: MusicComponent): ComponentResult;
  1089.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1090.     INLINE $2F3C, $0014, $0002, $7000, $A82A;
  1091.     {$ENDC}
  1092. FUNCTION NASaveMusicConfiguration(na: NoteAllocator): ComponentResult;
  1093.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1094.     INLINE $2F3C, $0000, $0003, $7000, $A82A;
  1095.     {$ENDC}
  1096. FUNCTION NANewNoteChannel(na: NoteAllocator; VAR noteRequest: NoteRequest; VAR outChannel: NoteChannel): ComponentResult;
  1097.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1098.     INLINE $2F3C, $0008, $0004, $7000, $A82A;
  1099.     {$ENDC}
  1100. FUNCTION NADisposeNoteChannel(na: NoteAllocator; noteChannel: NoteChannel): ComponentResult;
  1101.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1102.     INLINE $2F3C, $0004, $0005, $7000, $A82A;
  1103.     {$ENDC}
  1104. FUNCTION NAGetNoteChannelInfo(na: NoteAllocator; noteChannel: NoteChannel; VAR index: LONGINT; VAR part: LONGINT): ComponentResult;
  1105.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1106.     INLINE $2F3C, $000C, $0006, $7000, $A82A;
  1107.     {$ENDC}
  1108. FUNCTION NAPrerollNoteChannel(na: NoteAllocator; noteChannel: NoteChannel): ComponentResult;
  1109.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1110.     INLINE $2F3C, $0004, $0007, $7000, $A82A;
  1111.     {$ENDC}
  1112. FUNCTION NAUnrollNoteChannel(na: NoteAllocator; noteChannel: NoteChannel): ComponentResult;
  1113.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1114.     INLINE $2F3C, $0004, $0008, $7000, $A82A;
  1115.     {$ENDC}
  1116.  
  1117. FUNCTION NASetNoteChannelVolume(na: NoteAllocator; noteChannel: NoteChannel; volume: Fixed): ComponentResult;
  1118.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1119.     INLINE $2F3C, $0008, $000B, $7000, $A82A;
  1120.     {$ENDC}
  1121. FUNCTION NAResetNoteChannel(na: NoteAllocator; noteChannel: NoteChannel): ComponentResult;
  1122.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1123.     INLINE $2F3C, $0004, $000C, $7000, $A82A;
  1124.     {$ENDC}
  1125. FUNCTION NAPlayNote(na: NoteAllocator; noteChannel: NoteChannel; pitch: LONGINT; velocity: LONGINT): ComponentResult;
  1126.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1127.     INLINE $2F3C, $000C, $000D, $7000, $A82A;
  1128.     {$ENDC}
  1129. FUNCTION NASetController(na: NoteAllocator; noteChannel: NoteChannel; controllerNumber: LONGINT; controllerValue: LONGINT): ComponentResult;
  1130.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1131.     INLINE $2F3C, $000C, $000E, $7000, $A82A;
  1132.     {$ENDC}
  1133. FUNCTION NASetKnob(na: NoteAllocator; noteChannel: NoteChannel; knobNumber: LONGINT; knobValue: LONGINT): ComponentResult;
  1134.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1135.     INLINE $2F3C, $000C, $000F, $7000, $A82A;
  1136.     {$ENDC}
  1137. FUNCTION NAFindNoteChannelTone(na: NoteAllocator; noteChannel: NoteChannel; VAR td: ToneDescription; VAR instrumentNumber: LONGINT): ComponentResult;
  1138.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1139.     INLINE $2F3C, $000C, $0010, $7000, $A82A;
  1140.     {$ENDC}
  1141. FUNCTION NASetInstrumentNumber(na: NoteAllocator; noteChannel: NoteChannel; instrumentNumber: LONGINT): ComponentResult;
  1142.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1143.     INLINE $2F3C, $0008, $0011, $7000, $A82A;
  1144.     {$ENDC}
  1145.  
  1146.  
  1147. FUNCTION NAPickInstrument(na: NoteAllocator; filterProc: ModalFilterUPP; prompt: StringPtr; VAR sd: ToneDescription; flags: UInt32; refCon: LONGINT; reserved1: LONGINT; reserved2: LONGINT): ComponentResult;
  1148.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1149.     INLINE $2F3C, $001C, $0012, $7000, $A82A;
  1150.     {$ENDC}
  1151. FUNCTION NAPickArrangement(na: NoteAllocator; filterProc: ModalFilterUPP; prompt: StringPtr; zero1: LONGINT; zero2: LONGINT; t: Track; songName: StringPtr): ComponentResult;
  1152.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1153.     INLINE $2F3C, $0018, $0013, $7000, $A82A;
  1154.     {$ENDC}
  1155.  
  1156. FUNCTION NASetDefaultMIDIInput(na: NoteAllocator; VAR sc: SynthesizerConnections): ComponentResult;
  1157.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1158.     INLINE $2F3C, $0004, $0015, $7000, $A82A;
  1159.     {$ENDC}
  1160. FUNCTION NAGetDefaultMIDIInput(na: NoteAllocator; VAR sc: SynthesizerConnections): ComponentResult;
  1161.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1162.     INLINE $2F3C, $0004, $0016, $7000, $A82A;
  1163.     {$ENDC}
  1164.  
  1165. FUNCTION NAUseDefaultMIDIInput(na: NoteAllocator; readHook: MusicMIDIReadHookUPP; refCon: LONGINT; flags: UInt32): ComponentResult;
  1166.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1167.     INLINE $2F3C, $000C, $0019, $7000, $A82A;
  1168.     {$ENDC}
  1169. FUNCTION NALoseDefaultMIDIInput(na: NoteAllocator): ComponentResult;
  1170.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1171.     INLINE $2F3C, $0000, $001A, $7000, $A82A;
  1172.     {$ENDC}
  1173. FUNCTION NAStuffToneDescription(na: NoteAllocator; gmNumber: LONGINT; VAR td: ToneDescription): ComponentResult;
  1174.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1175.     INLINE $2F3C, $0008, $001B, $7000, $A82A;
  1176.     {$ENDC}
  1177. FUNCTION NACopyrightDialog(na: NoteAllocator; p: PicHandle; author: StringPtr; copyright: StringPtr; other: StringPtr; title: StringPtr; filterProc: ModalFilterUPP; refCon: LONGINT): ComponentResult;
  1178.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1179.     INLINE $2F3C, $001C, $001C, $7000, $A82A;
  1180.     {$ENDC}
  1181.  
  1182. {
  1183.       kNADummyOneSelect = 29
  1184.       kNADummyTwoSelect = 30
  1185. }
  1186.  
  1187. FUNCTION NAGetIndNoteChannel(na: NoteAllocator; index: LONGINT; VAR nc: NoteChannel; VAR seed: LONGINT): ComponentResult;
  1188.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1189.     INLINE $2F3C, $000C, $001F, $7000, $A82A;
  1190.     {$ENDC}
  1191.  
  1192. FUNCTION NAGetMIDIPorts(na: NoteAllocator; VAR inputPorts: QTMIDIPortListHandle; VAR outputPorts: QTMIDIPortListHandle): ComponentResult;
  1193.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1194.     INLINE $2F3C, $0008, $0021, $7000, $A82A;
  1195.     {$ENDC}
  1196. FUNCTION NAGetNoteRequest(na: NoteAllocator; noteChannel: NoteChannel; VAR nrOut: NoteRequest): ComponentResult;
  1197.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1198.     INLINE $2F3C, $0008, $0022, $7000, $A82A;
  1199.     {$ENDC}
  1200. FUNCTION NASendMIDI(na: NoteAllocator; noteChannel: NoteChannel; VAR mp: MusicMIDIPacket): ComponentResult;
  1201.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1202.     INLINE $2F3C, $0008, $0023, $7000, $A82A;
  1203.     {$ENDC}
  1204. FUNCTION NAPickEditInstrument(na: NoteAllocator; filterProc: ModalFilterUPP; prompt: StringPtr; refCon: LONGINT; nc: NoteChannel; ai: AtomicInstrument; flags: LONGINT): ComponentResult;
  1205.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1206.     INLINE $2F3C, $0018, $0024, $7000, $A82A;
  1207.     {$ENDC}
  1208. FUNCTION NANewNoteChannelFromAtomicInstrument(na: NoteAllocator; instrument: AtomicInstrumentPtr; flags: LONGINT; VAR outChannel: NoteChannel): ComponentResult;
  1209.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1210.     INLINE $2F3C, $000C, $0025, $7000, $A82A;
  1211.     {$ENDC}
  1212. FUNCTION NASetAtomicInstrument(na: NoteAllocator; noteChannel: NoteChannel; instrument: AtomicInstrumentPtr; flags: LONGINT): ComponentResult;
  1213.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1214.     INLINE $2F3C, $000C, $0026, $7000, $A82A;
  1215.     {$ENDC}
  1216.  
  1217.  
  1218. FUNCTION NAGetKnob(na: NoteAllocator; noteChannel: NoteChannel; knobNumber: LONGINT; VAR knobValue: LONGINT): ComponentResult;
  1219.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1220.     INLINE $2F3C, $000C, $0028, $7000, $A82A;
  1221.     {$ENDC}
  1222. FUNCTION NATask(na: NoteAllocator): ComponentResult;
  1223.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1224.     INLINE $2F3C, $0000, $0029, $7000, $A82A;
  1225.     {$ENDC}
  1226. FUNCTION NASetNoteChannelBalance(na: NoteAllocator; noteChannel: NoteChannel; balance: LONGINT): ComponentResult;
  1227.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1228.     INLINE $2F3C, $0008, $002A, $7000, $A82A;
  1229.     {$ENDC}
  1230. FUNCTION NASetInstrumentNumberInterruptSafe(na: NoteAllocator; noteChannel: NoteChannel; instrumentNumber: LONGINT): ComponentResult;
  1231.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1232.     INLINE $2F3C, $0008, $002B, $7000, $A82A;
  1233.     {$ENDC}
  1234. FUNCTION NASetNoteChannelSoundLocalization(na: NoteAllocator; noteChannel: NoteChannel; data: Handle): ComponentResult;
  1235.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1236.     INLINE $2F3C, $0008, $002C, $7000, $A82A;
  1237.     {$ENDC}
  1238. FUNCTION NAGetController(na: NoteAllocator; noteChannel: NoteChannel; controllerNumber: LONGINT; VAR controllerValue: LONGINT): ComponentResult;
  1239.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1240.     INLINE $2F3C, $000C, $002D, $7000, $A82A;
  1241.     {$ENDC}
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247. CONST
  1248.     kTuneQueueDepth                = 8;                            {  Deepest you can queue tune segments  }
  1249.  
  1250.  
  1251.  
  1252. TYPE
  1253.     TuneStatusPtr = ^TuneStatus;
  1254.     TuneStatus = RECORD
  1255.         tune:                    LongintPtr;                                {  currently playing tune  }
  1256.         tunePtr:                LongintPtr;                                {  position within currently playing piece  }
  1257.         time:                    TimeValue;                                {  current tune time  }
  1258.         queueCount:                INTEGER;                                {  how many pieces queued up?  }
  1259.         queueSpots:                INTEGER;                                {  How many more tunepieces can be queued  }
  1260.         queueTime:                TimeValue;                                {  How much time is queued up? (can be very inaccurate)  }
  1261.         reserved:                ARRAY [0..2] OF LONGINT;
  1262.     END;
  1263.  
  1264. {$IFC TYPED_FUNCTION_POINTERS}
  1265.     TuneCallBackProcPtr = PROCEDURE({CONST}VAR status: TuneStatus; refCon: LONGINT);
  1266. {$ELSEC}
  1267.     TuneCallBackProcPtr = ProcPtr;
  1268. {$ENDC}
  1269.  
  1270. {$IFC TYPED_FUNCTION_POINTERS}
  1271.     TunePlayCallBackProcPtr = PROCEDURE(VAR event: UInt32; seed: LONGINT; refCon: LONGINT);
  1272. {$ELSEC}
  1273.     TunePlayCallBackProcPtr = ProcPtr;
  1274. {$ENDC}
  1275.  
  1276.     TuneCallBackUPP = UniversalProcPtr;
  1277.     TunePlayCallBackUPP = UniversalProcPtr;
  1278.     TunePlayer                            = ComponentInstance;
  1279.  
  1280. CONST
  1281.     kTunePlayerComponentType    = 'tune';
  1282.  
  1283.  
  1284. FUNCTION TuneSetHeader(tp: TunePlayer; VAR header: UInt32): ComponentResult;
  1285.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1286.     INLINE $2F3C, $0004, $0004, $7000, $A82A;
  1287.     {$ENDC}
  1288. FUNCTION TuneGetTimeBase(tp: TunePlayer; VAR tb: TimeBase): ComponentResult;
  1289.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1290.     INLINE $2F3C, $0004, $0005, $7000, $A82A;
  1291.     {$ENDC}
  1292. FUNCTION TuneSetTimeScale(tp: TunePlayer; scale: TimeScale): ComponentResult;
  1293.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1294.     INLINE $2F3C, $0004, $0006, $7000, $A82A;
  1295.     {$ENDC}
  1296. FUNCTION TuneGetTimeScale(tp: TunePlayer; VAR scale: TimeScale): ComponentResult;
  1297.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1298.     INLINE $2F3C, $0004, $0007, $7000, $A82A;
  1299.     {$ENDC}
  1300. FUNCTION TuneGetIndexedNoteChannel(tp: TunePlayer; i: LONGINT; VAR nc: NoteChannel): ComponentResult;
  1301.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1302.     INLINE $2F3C, $0008, $0008, $7000, $A82A;
  1303.     {$ENDC}
  1304.  
  1305. { Values for when to start. }
  1306.  
  1307. CONST
  1308.     kTuneStartNow                = 1;                            {  start after buffer is implied  }
  1309.     kTuneDontClipNotes            = 2;                            {  allow notes to finish their durations outside sample  }
  1310.     kTuneExcludeEdgeNotes        = 4;                            {  dont play notes that start at end of tune  }
  1311.     kTuneQuickStart                = 8;                            {  Leave all the controllers where they are, ignore start time  }
  1312.     kTuneLoopUntil                = 16;                            {  loop a queued tune if there's nothing else in the queue }
  1313.     kTunePlayDifference            = 32;                            {  by default, the tune difference is skipped }
  1314.     kTunePlayConcurrent            = 64;                            {  dont block the next tune sequence with this one }
  1315.     kTuneStartNewMaster            = 16384;
  1316.  
  1317. FUNCTION TuneQueue(tp: TunePlayer; VAR tune: UInt32; tuneRate: Fixed; tuneStartPosition: UInt32; tuneStopPosition: UInt32; queueFlags: UInt32; callBackProc: TuneCallBackUPP; refCon: LONGINT): ComponentResult;
  1318.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1319.     INLINE $2F3C, $001C, $000A, $7000, $A82A;
  1320.     {$ENDC}
  1321. FUNCTION TuneInstant(tp: TunePlayer; VAR tune: UInt32; tunePosition: UInt32): ComponentResult;
  1322.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1323.     INLINE $2F3C, $0008, $000B, $7000, $A82A;
  1324.     {$ENDC}
  1325. FUNCTION TuneGetStatus(tp: TunePlayer; VAR status: TuneStatus): ComponentResult;
  1326.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1327.     INLINE $2F3C, $0004, $000C, $7000, $A82A;
  1328.     {$ENDC}
  1329. { Values for stopping. }
  1330.  
  1331. CONST
  1332.     kTuneStopFade                = 1;                            {  do a quick, synchronous fadeout  }
  1333.     kTuneStopSustain            = 2;                            {  don't silece notes  }
  1334.     kTuneStopInstant            = 4;                            {  silence notes fast (else, decay them)  }
  1335.     kTuneStopReleaseChannels    = 8;                            {  afterwards, let the channels go  }
  1336.  
  1337. FUNCTION TuneStop(tp: TunePlayer; stopFlags: LONGINT): ComponentResult;
  1338.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1339.     INLINE $2F3C, $0004, $000D, $7000, $A82A;
  1340.     {$ENDC}
  1341.  
  1342. FUNCTION TuneSetVolume(tp: TunePlayer; volume: Fixed): ComponentResult;
  1343.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1344.     INLINE $2F3C, $0004, $0010, $7000, $A82A;
  1345.     {$ENDC}
  1346. FUNCTION TuneGetVolume(tp: TunePlayer): ComponentResult;
  1347.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1348.     INLINE $2F3C, $0000, $0011, $7000, $A82A;
  1349.     {$ENDC}
  1350. FUNCTION TunePreroll(tp: TunePlayer): ComponentResult;
  1351.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1352.     INLINE $2F3C, $0000, $0012, $7000, $A82A;
  1353.     {$ENDC}
  1354. FUNCTION TuneUnroll(tp: TunePlayer): ComponentResult;
  1355.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1356.     INLINE $2F3C, $0000, $0013, $7000, $A82A;
  1357.     {$ENDC}
  1358. FUNCTION TuneSetNoteChannels(tp: TunePlayer; count: UInt32; VAR noteChannelList: NoteChannel; playCallBackProc: TunePlayCallBackUPP; refCon: LONGINT): ComponentResult;
  1359.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1360.     INLINE $2F3C, $0010, $0014, $7000, $A82A;
  1361.     {$ENDC}
  1362. FUNCTION TuneSetPartTranspose(tp: TunePlayer; part: UInt32; transpose: LONGINT; velocityShift: LONGINT): ComponentResult;
  1363.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1364.     INLINE $2F3C, $000C, $0015, $7000, $A82A;
  1365.     {$ENDC}
  1366.  
  1367. FUNCTION TuneGetNoteAllocator(tp: TunePlayer): NoteAllocator;
  1368.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1369.     INLINE $2F3C, $0000, $0017, $7000, $A82A;
  1370.     {$ENDC}
  1371. FUNCTION TuneSetSofter(tp: TunePlayer; softer: LONGINT): ComponentResult;
  1372.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1373.     INLINE $2F3C, $0004, $0018, $7000, $A82A;
  1374.     {$ENDC}
  1375. FUNCTION TuneTask(tp: TunePlayer): ComponentResult;
  1376.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1377.     INLINE $2F3C, $0000, $0019, $7000, $A82A;
  1378.     {$ENDC}
  1379. FUNCTION TuneSetBalance(tp: TunePlayer; balance: LONGINT): ComponentResult;
  1380.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1381.     INLINE $2F3C, $0004, $001A, $7000, $A82A;
  1382.     {$ENDC}
  1383. FUNCTION TuneSetSoundLocalization(tp: TunePlayer; data: Handle): ComponentResult;
  1384.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1385.     INLINE $2F3C, $0004, $001B, $7000, $A82A;
  1386.     {$ENDC}
  1387. FUNCTION TuneSetHeaderWithSize(tp: TunePlayer; VAR header: UInt32; size: UInt32): ComponentResult;
  1388.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1389.     INLINE $2F3C, $0008, $001C, $7000, $A82A;
  1390.     {$ENDC}
  1391. { flags for part mix. }
  1392.  
  1393. CONST
  1394.     kTuneMixMute                = 1;                            {  disable a part  }
  1395.     kTuneMixSolo                = 2;                            {  if any parts soloed, play only soloed parts  }
  1396.  
  1397.  
  1398. FUNCTION TuneSetPartMix(tp: TunePlayer; partNumber: UInt32; volume: LONGINT; balance: LONGINT; mixFlags: LONGINT): ComponentResult;
  1399.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1400.     INLINE $2F3C, $0010, $001D, $7000, $A82A;
  1401.     {$ENDC}
  1402. FUNCTION TuneGetPartMix(tp: TunePlayer; partNumber: UInt32; VAR volumeOut: LONGINT; VAR balanceOut: LONGINT; VAR mixFlagsOut: LONGINT): ComponentResult;
  1403.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1404.     INLINE $2F3C, $0010, $001E, $7000, $A82A;
  1405.     {$ENDC}
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411. TYPE
  1412.     MusicOpWord                            = UInt32;
  1413.     MusicOpWordPtr                        = ^UInt32;
  1414. {     QuickTime Music Track Event Formats:
  1415.  
  1416.     At this time, QuickTime music tracks support 5 different event types -- REST events,
  1417.     short NOTE events, short CONTROL events, short GENERAL events, Long NOTE events, 
  1418.     long CONTROL events, and variable GENERAL events.
  1419.  
  1420.         • REST Event (4 bytes/event):
  1421.     
  1422.             (0 0 0) (5-bit UNUSED) (24-bit Rest Duration)
  1423.         
  1424.         • Short NOTE Events (4 bytes/event):
  1425.     
  1426.             (0 0 1) (5-bit Part) (6-bit Pitch) (7-bit Volume) (11-bit Duration)
  1427.         
  1428.             where:    Pitch is offset by 32 (Actual pitch = pitch field + 32)
  1429.  
  1430.         • Short CONTROL Events (4 bytes/event):
  1431.     
  1432.             (0 1 0) (5-bit Part) (8-bit Controller) (1-bit UNUSED) (1-bit Sign) (7-bit MSB) (7-bit LSB)
  1433.                                                                          ( or 15-bit Signed Value)
  1434.         • Short GENERAL Event (4 bytes/event):
  1435.     
  1436.             (0 1 1) (1-bit UNUSED) (12-bit Sub-Type) (16-bit Value)
  1437.     
  1438.         • Long NOTE Events (8 bytes/event):
  1439.     
  1440.             (1 0 0 1) (12-bit Part) (1-bit UNUSED) (7-bit Pitch) (1-bit UNUSED) (7-bit Volume)
  1441.             (1 0) (8-bit UNUSED) (22-bit Duration)
  1442.         
  1443.         • Long CONTROL Event (8 bytes/event):
  1444.         
  1445.             (1 0 1 0) (12-bit Part) (16-bit Value MSB) 
  1446.             (1 0) (14-bit Controller) (16-bit Value LSB)
  1447.     
  1448.         • Long KNOB Event (8 bytes/event):
  1449.     
  1450.             (1 0 1 1) (12-bit Sub-Type) (16-bit Value MSB)
  1451.             (1 0) (14-bit KNOB) (16-bit Value LSB)
  1452.     
  1453.         • Variable GENERAL Length Events (N bytes/event):
  1454.     
  1455.             (1 1 1 1) (12-bit Sub-Type) (16-bit Length)
  1456.                 :
  1457.             (32-bit Data values)
  1458.                 :
  1459.             (1 1) (14-bit UNUSED) (16-bit Length)
  1460.     
  1461.             where:    Length field is the number of LONG words in the record.
  1462.                     Lengths include the first and last long words (Minimum length = 2)
  1463.                 
  1464.     The following event type values have not been used yet and are reserved for 
  1465.     future expansion:
  1466.         
  1467.         • (1 0 0 0)        (8 bytes/event)
  1468.         • (1 1 0 0)        (N bytes/event)
  1469.         • (1 1 0 1)        (N bytes/event)
  1470.         • (1 1 1 0)        (N bytes/event)
  1471.         
  1472.     For all events, the following generalizations apply:
  1473.     
  1474.         -    All duration values are specified in Millisecond units.
  1475.         -     Pitch values are intended to map directly to the MIDI key numbers.
  1476.         -    Controllers from 0 to 127 correspond to the standard MIDI controllers.
  1477.             Controllers greater than 127 correspond to other controls (i.e., Pitch Bend, 
  1478.             Key Pressure, and Channel Pressure).    
  1479. }
  1480.  
  1481. {  Defines for the implemented music event data fields }
  1482.  
  1483. CONST
  1484.     kRestEventType                = $00000000;                    {  lower 3-bits  }
  1485.     kNoteEventType                = $00000001;                    {  lower 3-bits  }
  1486.     kControlEventType            = $00000002;                    {  lower 3-bits  }
  1487.     kMarkerEventType            = $00000003;                    {  lower 3-bits  }
  1488.     kUndefined1EventType        = $00000008;                    {  4-bits  }
  1489.     kXNoteEventType                = $00000009;                    {  4-bits  }
  1490.     kXControlEventType            = $0000000A;                    {  4-bits  }
  1491.     kKnobEventType                = $0000000B;                    {  4-bits  }
  1492.     kUndefined2EventType        = $0000000C;                    {  4-bits  }
  1493.     kUndefined3EventType        = $0000000D;                    {  4-bits  }
  1494.     kUndefined4EventType        = $0000000E;                    {  4-bits  }
  1495.     kGeneralEventType            = $0000000F;                    {  4-bits  }
  1496.     kXEventLengthBits            = $00000002;                    {  2 bits: indicates 8-byte event record  }
  1497.     kGeneralEventLengthBits        = $00000003;                    {  2 bits: indicates variable length event record  }
  1498.     kEventLen                    = 1;                            {  length of events in long words  }
  1499.     kXEventLen                    = 2;
  1500.     kRestEventLen                = 1;                            {  length of events in long words  }
  1501.     kNoteEventLen                = 1;
  1502.     kControlEventLen            = 1;
  1503.     kMarkerEventLen                = 1;
  1504.     kXNoteEventLen                = 2;
  1505.     kXControlEventLen            = 2;
  1506.     kGeneralEventLen            = 2;                            {  2 or more, however  }
  1507.                                                                 {  Universal Event Defines }
  1508.     kEventLengthFieldPos        = 30;                            {  by looking at these two bits of the 1st or last word               }
  1509.     kEventLengthFieldWidth        = 2;                            {  of an event you can determine the event length                       }
  1510.                                                                 {  length field: 0 & 1 => 1 long; 2 => 2 longs; 3 => variable length  }
  1511.     kEventTypeFieldPos            = 29;                            {  event type field for short events  }
  1512.     kEventTypeFieldWidth        = 3;                            {  short type is 3 bits  }
  1513.     kXEventTypeFieldPos            = 28;                            {  event type field for extended events  }
  1514.     kXEventTypeFieldWidth        = 4;                            {  extended type is 4 bits  }
  1515.     kEventPartFieldPos            = 24;
  1516.     kEventPartFieldWidth        = 5;
  1517.     kXEventPartFieldPos            = 16;                            {  in the 1st long word  }
  1518.     kXEventPartFieldWidth        = 12;                            {  Rest Events }
  1519.     kRestEventDurationFieldPos    = 0;
  1520.     kRestEventDurationFieldWidth = 24;
  1521.     kRestEventDurationMax        = $00FFFFFF;                    {  Note Events }
  1522.     kNoteEventPitchFieldPos        = 18;
  1523.     kNoteEventPitchFieldWidth    = 6;
  1524.     kNoteEventPitchOffset        = 32;                            {  add to value in pitch field to get actual pitch  }
  1525.     kNoteEventVolumeFieldPos    = 11;
  1526.     kNoteEventVolumeFieldWidth    = 7;
  1527.     kNoteEventVolumeOffset        = 0;                            {  add to value in volume field to get actual volume  }
  1528.     kNoteEventDurationFieldPos    = 0;
  1529.     kNoteEventDurationFieldWidth = 11;
  1530.     kNoteEventDurationMax        = $000007FF;
  1531.     kXNoteEventPitchFieldPos    = 0;                            {  in the 1st long word  }
  1532.     kXNoteEventPitchFieldWidth    = 16;
  1533.     kXNoteEventDurationFieldPos    = 0;                            {  in the 2nd long word  }
  1534.     kXNoteEventDurationFieldWidth = 22;
  1535.     kXNoteEventDurationMax        = $003FFFFF;
  1536.     kXNoteEventVolumeFieldPos    = 22;                            {  in the 2nd long word  }
  1537.     kXNoteEventVolumeFieldWidth    = 7;                            {  Control Events }
  1538.     kControlEventControllerFieldPos = 16;
  1539.     kControlEventControllerFieldWidth = 8;
  1540.     kControlEventValueFieldPos    = 0;
  1541.     kControlEventValueFieldWidth = 16;
  1542.     kXControlEventControllerFieldPos = 0;                        {  in the 2nd long word  }
  1543.     kXControlEventControllerFieldWidth = 16;
  1544.     kXControlEventValueFieldPos    = 0;                            {  in the 1st long word  }
  1545.     kXControlEventValueFieldWidth = 16;                            {  Knob Events }
  1546.     kKnobEventValueHighFieldPos    = 0;                            {  1st long word  }
  1547.     kKnobEventValueHighFieldWidth = 16;
  1548.     kKnobEventKnobFieldPos        = 16;                            {  2nd long word  }
  1549.     kKnobEventKnobFieldWidth    = 14;
  1550.     kKnobEventValueLowFieldPos    = 0;                            {  2nd long word  }
  1551.     kKnobEventValueLowFieldWidth = 16;                            {  Marker Events }
  1552.     kMarkerEventSubtypeFieldPos    = 16;
  1553.     kMarkerEventSubtypeFieldWidth = 8;
  1554.     kMarkerEventValueFieldPos    = 0;
  1555.     kMarkerEventValueFieldWidth    = 16;                            {  General Events }
  1556.     kGeneralEventSubtypeFieldPos = 16;                            {  in the last long word  }
  1557.     kGeneralEventSubtypeFieldWidth = 14;
  1558.     kGeneralEventLengthFieldPos    = 0;                            {  in the 1st & last long words  }
  1559.     kGeneralEventLengthFieldWidth = 16;
  1560.  
  1561. {$IFC TARGET_RT_LITTLE_ENDIAN }
  1562.     kEndMarkerValue                = $00000060;
  1563.  
  1564. {$ELSEC}
  1565.     kEndMarkerValue                = $60000000;
  1566.  
  1567. {$ENDC}  {TARGET_RT_LITTLE_ENDIAN}
  1568.  
  1569. {  General Event Defined Types }
  1570.     kGeneralEventNoteRequest    = 1;                            {  Encapsulates NoteRequest data structure  }
  1571.     kGeneralEventPartKey        = 4;
  1572.     kGeneralEventTuneDifference    = 5;                            {  Contains a standard sequence, with end marker, for the tune difference of a sequence piece (halts QuickTime 2.0 Music)  }
  1573.     kGeneralEventAtomicInstrument = 6;                            {  Encapsulates AtomicInstrument record  }
  1574.     kGeneralEventKnob            = 7;                            {  knobID/knobValue pairs; smallest event is 4 longs  }
  1575.     kGeneralEventMIDIChannel    = 8;                            {  used in tune header, one longword identifies the midi channel it originally came from  }
  1576.     kGeneralEventPartChange        = 9;                            {  used in tune sequence, one longword identifies the tune part which can now take over this part's note channel (similar to program change) (halts QuickTime 2.0 Music) }
  1577.     kGeneralEventNoOp            = 10;                            {  guaranteed to do nothing and be ignored. (halts QuickTime 2.0 Music)  }
  1578.     kGeneralEventUsedNotes        = 11;                            {  four longwords specifying which midi notes are actually used, 0..127 msb to lsb  }
  1579.     kGeneralEventPartMix        = 12;                            {  three longwords: Fixed volume, long balance, long flags  }
  1580.  
  1581. {  Marker Event Defined Types        // marker is 60 ee vv vv in hex, where e = event type, and v = value }
  1582.     kMarkerEventEnd                = 0;                            {  marker type 0 means: value 0 - stop, value != 0 - ignore }
  1583.     kMarkerEventBeat            = 1;                            {  value 0 = single beat; anything else is 65536ths-of-a-beat (quarter note) }
  1584.     kMarkerEventTempo            = 2;                            {  value same as beat marker, but indicates that a tempo event should be computed (based on where the next beat or tempo marker is) and emitted upon export }
  1585.  
  1586.     kCurrentlyNativeEndian        = 1;
  1587.     kCurrentlyNotNativeEndian    = 2;
  1588.  
  1589. { UPP call backs }
  1590.     uppMusicMIDISendProcInfo = $00000FF0;
  1591.     uppMusicMIDIReadHookProcInfo = $000003F0;
  1592.     uppMusicOfflineDataProcInfo = $00000FF0;
  1593.     uppTuneCallBackProcInfo = $000003C0;
  1594.     uppTunePlayCallBackProcInfo = $00000FC0;
  1595.  
  1596. FUNCTION NewMusicMIDISendProc(userRoutine: MusicMIDISendProcPtr): MusicMIDISendUPP;
  1597.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1598.     INLINE $2E9F;
  1599.     {$ENDC}
  1600.  
  1601. FUNCTION NewMusicMIDIReadHookProc(userRoutine: MusicMIDIReadHookProcPtr): MusicMIDIReadHookUPP;
  1602.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1603.     INLINE $2E9F;
  1604.     {$ENDC}
  1605.  
  1606. FUNCTION NewMusicOfflineDataProc(userRoutine: MusicOfflineDataProcPtr): MusicOfflineDataUPP;
  1607.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1608.     INLINE $2E9F;
  1609.     {$ENDC}
  1610.  
  1611. FUNCTION NewTuneCallBackProc(userRoutine: TuneCallBackProcPtr): TuneCallBackUPP;
  1612.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1613.     INLINE $2E9F;
  1614.     {$ENDC}
  1615.  
  1616. FUNCTION NewTunePlayCallBackProc(userRoutine: TunePlayCallBackProcPtr): TunePlayCallBackUPP;
  1617.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1618.     INLINE $2E9F;
  1619.     {$ENDC}
  1620.  
  1621. FUNCTION CallMusicMIDISendProc(self: ComponentInstance; refCon: LONGINT; VAR mmp: MusicMIDIPacket; userRoutine: MusicMIDISendUPP): ComponentResult;
  1622.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1623.     INLINE $205F, $4E90;
  1624.     {$ENDC}
  1625.  
  1626. FUNCTION CallMusicMIDIReadHookProc(VAR mp: MusicMIDIPacket; myRefCon: LONGINT; userRoutine: MusicMIDIReadHookUPP): ComponentResult;
  1627.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1628.     INLINE $205F, $4E90;
  1629.     {$ENDC}
  1630.  
  1631. FUNCTION CallMusicOfflineDataProc(SoundData: Ptr; numBytes: LONGINT; myRefCon: LONGINT; userRoutine: MusicOfflineDataUPP): ComponentResult;
  1632.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1633.     INLINE $205F, $4E90;
  1634.     {$ENDC}
  1635.  
  1636. PROCEDURE CallTuneCallBackProc({CONST}VAR status: TuneStatus; refCon: LONGINT; userRoutine: TuneCallBackUPP);
  1637.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1638.     INLINE $205F, $4E90;
  1639.     {$ENDC}
  1640.  
  1641. PROCEDURE CallTunePlayCallBackProc(VAR event: UInt32; seed: LONGINT; refCon: LONGINT; userRoutine: TunePlayCallBackUPP);
  1642.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1643.     INLINE $205F, $4E90;
  1644.     {$ENDC}
  1645.  
  1646. {$ALIGN RESET}
  1647. {$POP}
  1648.  
  1649. {$SETC UsingIncludes := QuickTimeMusicIncludes}
  1650.  
  1651. {$ENDC} {__QUICKTIMEMUSIC__}
  1652.  
  1653. {$IFC NOT UsingIncludes}
  1654.  END.
  1655. {$ENDC}
  1656.